import { Component, OnInit ,Inject} from '@angular/core';
import {Router} from '@angular/router';
import { Service } from '../../server/server';
declare var $:any;

@Component({
  selector: 'app-sidebar-system',
  templateUrl: './sidebar-system.component.html'
})
export class SidebarSystemComponent implements OnInit {

  right: any = {
    "systemTemplateTath" : {},
    "systemTableTag" : {},
    "systemThemeTag" : {},
    "systemPushed" : {},
    "systemProductType" : {},
    "systemInnerindexStyle" : {},
    "systemTable" : {},
    "systemSynonym" : {},
    "sysconfig":{},
    "systemDatabase":{},
    "systemProject":{}
 };

  constructor(public router:Router,private server:Service) {
    this.right = $.extend(this.right, server.getRight());
  }

  public isActive= this.server.isActive;
  ngOnInit() {
    this.server.eventEmit.subscribe((value: any) => {
      this.isActive=value;
    });
  }

  ngDoCheck(){
    this.right = $.extend(this.right, this.server.getRight());
  }

  // public closeindentbutton(){
  //   if(document.body.offsetWidth < 1020){
  //     this.server.closeindentbutton();
  //   }  
  // }

}
